﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Omabar.BLL;
using Omabar.Model;

namespace Omabar.CMS.CMS
{
    public partial class TailorEdit : System.Web.UI.Page
    {
        protected Tailor tailor = null;
        protected List<PHOTO> photos;
        protected string tailor_id;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Tailor_BLL tailorBLL = new Tailor_BLL();
                Photo_BLL photoBLL = new Photo_BLL();

                tailor_id = Request["id"];
                tailor = tailorBLL.GetModel(tailor_id);
                if (tailor == null) tailor = new Tailor();


                photos = photoBLL.GetModels(string.Format("SELECT TOP 10 T.PHOTO_ID,PHOTO_NAME,PHOTO_URL,PHOTO_DES,PHOTO_HOT,PHOTO_COVER FROM TAILOR_GALLERY T LEFT JOIN PHOTO V ON T.PHOTO_ID=V.PHOTO_ID WHERE T.tailor_id='{0}'", tailor.TAILOR_ID));

                if (photos == null) photos = new List<PHOTO>();


            }
        }
    }
}